"""
该文件用于 封装界面
"""
import uiautomation as auto
from utils.utils_log import loggerCase
from page.base_page import BasePage
from common_ai_img import AIButton, Icon, OcrText, Anchor


class MeshPage(BasePage):
    """封装页面"""

    # 优化封装按钮
    __optMesh_button = AIButton(Icon("optimize mesh"))

    # 普通封装按钮
    __mesh_button = AIButton(Icon("mesh"))

    # 非封闭封装
    __unwatertight_model = AIButton(Icon("unwatertight model"))

    # 半封闭封装
    __semi_watertight_model = AIButton(Icon("semi watertight model"))

    # 封闭闭封装
    __watertight_model = AIButton(Icon("watertight model"))

    # 无优化
    __optimization_none = AIButton(OcrText("None"))

    # 优化标准
    __optimization_standard = AIButton(OcrText("Standard"))

    # 优化低
    __optimization_low = AIButton(OcrText("None"), OcrText("Low"), Anchor.RIGHT)

    # 优化高
    __optimization_high = AIButton(OcrText("Standard"), OcrText("High"), Anchor.RIGHT)

    # 平滑低
    __smooth_low = AIButton(OcrText("Smooth"), OcrText("Low"), Anchor.BOTTOM)

    # 平滑中
    __smooth_med = AIButton(OcrText("Med"))

    # 平滑高
    __smooth_high = AIButton(OcrText("Med"), OcrText("High"), Anchor.RIGHT)

    # 推荐参数
    # __recommended_parameters = auto.TextControl(SubName="access_Recommended parameters").GetNextSiblingControl()


    def click_optMesh_button(self, max_wait_time=3):
        """选择优化封装"""
        loggerCase.info("选择优化封装")
        self.click(MeshPage.__optMesh_button, max_wait_time=max_wait_time)

    def click_mesh_method_button(self, max_wait_time=3):
        """选择普通封装"""
        loggerCase.info("选择普通封装")
        self.click(MeshPage.__mesh_button, max_wait_time=max_wait_time)


    def click_optimization_none(self, max_wait_time=3):
        """选择无优化"""
        loggerCase.info("选择无优化")
        self.click(MeshPage.__optimization_none, max_wait_time=max_wait_time)

    def click_optimization_standard(self, max_wait_time=3):
        """选择标准优化"""
        loggerCase.info("选择标准优化")
        self.click(MeshPage.__optimization_standard, max_wait_time=max_wait_time)


    def click_optimization_high(self, max_wait_time=3):
        """选择优化高"""
        loggerCase.info("选择优化高")
        self.click(MeshPage.__optimization_high, max_wait_time=max_wait_time)

    def click_smooth_low(self, max_wait_time=3):
        """选择平滑低"""
        loggerCase.info("选择平滑低")
        self.click(MeshPage.__smooth_low, max_wait_time=max_wait_time)

    def click_smooth_med(self, max_wait_time=3):
        """选择平滑中"""
        loggerCase.info("选择平滑中")
        self.click(MeshPage.__smooth_med, max_wait_time=max_wait_time)

    def click_smooth_high(self, max_wait_time=3):
        """选择平滑高"""
        loggerCase.info("选择平滑高")
        self.click(MeshPage.__smooth_high, max_wait_time=max_wait_time)


    # def click_recommended_parameters(self, max_wait_time=3):
    #     """使用推荐参数"""
    #     loggerCase.info("使用推荐参数")
    #     self.click(self.__recommended_parameters, max_wait_time=max_wait_time)
